import type { ProColumns } from '@ant-design/pro-table';

export type columnsDataType = {
  order: number;
  acName: string;
  custNo: string;
  acNo: string;
  balance: string;
  custType: string;
  openAcDate: string;
  status: string;
  startTime: string;
  endTime: string;
};

const columnsData: ProColumns<columnsDataType>[] = [
  // 配置搜索框
  {
    title: '户名',
    dataIndex: 'acName',
    hideInTable: true,
    fieldProps: {
      maxLength: 20,
    },
  },
  {
    title: '账号',
    dataIndex: 'acNo',
    hideInTable: true,
    fieldProps: {
      maxLength: 20,
    },
  },
  {
    title: '账户状态',
    dataIndex: 'status',
    valueType: 'select',
    hideInTable: true,
    valueEnum: {
      0: {
        text: '正常',
      },
      1: {
        text: '未激活',
      },
      2: {
        text: '挂失',
      },
      3: {
        text: '冻结',
      },
      4: {
        text: '销户',
      },
      5: {
        text: '锁定',
      },
    },
  },
  {
    title: '开户日期',
    dataIndex: 'registerDate',
    valueType: 'dateRange',
    colSize: 1,
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
          startTime: value[0],
          endTime: value[1],
        };
        1;
      },
    },
  },

  // table里面的内容
  {
    title: '账户流水编号',
    dataIndex: 'serialNo',
    hideInSearch: true,
    width: 165,
  },
  {
    title: '客户编号',
    width: 165,
    dataIndex: 'customerNo',
    hideInSearch: true,
  },
  {
    title: '账户编号',
    width: 165,
    dataIndex: 'accountNo',
    hideInSearch: true,
  },
  {
    title: '账号类型',
    width: 80,
    dataIndex: 'accountType',
    hideInSearch: true,
    valueType: 'select',
    valueEnum: {
      0: {
        text: '个人账户',
      },
      1: {
        text: '企业账户',
      },
    },
  },
  {
    title: '类型',
    width: 60,
    dataIndex: 'orderType',
    hideInSearch: true,
    valueType: 'select',
    valueEnum: {
      0: {
        text: '支付',
      },
      1: {
        text: '退款',
      },
      2: {
        text: '出售',
      },
    },
  },
  {
    title: '订单号',
    width: 165,
    dataIndex: 'orderNo',
    hideInSearch: true,
  },
  {
    title: '出入帐',
    width: 80,
    dataIndex: 'inOutFlag',
    hideInSearch: true,
    valueType: 'select',
    valueEnum: {
      0: {
        text: '出账',
      },
      1: {
        text: '入账',
      },
    },
  },
  {
    title: '金额',
    width: 100,
    dataIndex: 'amount',
    hideInSearch: true,
  },
  {
    title: '币种',
    width: 60,
    dataIndex: 'ccy',
    hideInSearch: true,
  },
  {
    title: '交易类型',
    width: 80,
    dataIndex: 'tradeType',
    hideInSearch: true,
    valueType: 'select',
    valueEnum: {
      0: {
        text: '充值',
      },
      1: {
        text: '转账',
      },
      2: {
        text: '提现',
      },
    },
  },
  {
    title: '创建时间',
    width: 160,
    dataIndex: 'createTime',
    hideInSearch: true,
  },
  {
    title: '备注',
    width: 160,
    dataIndex: 'remark',
    hideInSearch: true,
  },
  {
    title: '逻辑删除',
    width: 100,
    hideInSearch: true,
    dataIndex: 'delFlag',
    valueType: 'select',
    valueEnum: {
      0: {
        text: '未删除',
      },
      1: {
        text: '已删除',
      },
    },
  },
  {
    title: '租户id',
    width: 160,
    dataIndex: 'tenantId',
    hideInSearch: true,
  },
  {
    title: '操作',
    width: 100,
    hideInSearch: true,
    dataIndex: 'action',
    fixed: 'right',
  },
];

export default columnsData;
